var t = getApp();

Page({
    data: {
        gifUrl: "",
        urlList: [],
        ad: {},
        tempGif: ""
    },
    onLoad: function(i) {
        this.setData({
            ad: t.globalData.ad
        });
        var a = i.gifUrl, e = [], s = this;
        console.log("接收到" + a), e.push(a), this.setData({
            gifUrl: i.gifUrl,
            urlList: e
        }), wx.showLoading({
            title: "获取GIF"
        }), wx.downloadFile({
            url: i.gifUrl,
            success: function(t) {
                wx.hideLoading({
                    success: function(t) {}
                }), s.setData({
                    tempGif: t.tempFilePath
                });
            }
        });
    },
    previewImage: function(t) {
        var i = this;
        wx.previewImage({
            urls: [ i.data.tempGif ]
        });
    },
    onShareAppMessage: function(t) {
        return {
            title: "GIF表情包制作",
            path: "/pages/gifmaker/showGif?gifUrl=" + this.data.gifUrl
        };
    },
    saveToPhone: function() {
        var t = this;
        wx.showLoading({
            title: "保存中"
        }), wx.saveImageToPhotosAlbum({
            filePath: t.data.tempGif,
            success: function(t) {
                wx.hideLoading({
                    success: function(t) {}
                });
            }
        });
    }
});